package com.ruoyi.Shop_review.server.service.impl;

import com.ruoyi.Shop_review.server.domain.MgShopReview;
import com.ruoyi.Shop_review.server.mapper.mgShopReviewMapper;
import com.ruoyi.Shop_review.server.service.mgShopReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Classname mgShopReviewServiceImpl
 * @Description
 * @Date 2025/5/27 18:43
 * @Created by FINE
 */
@Service
public class mgShopReviewServiceImpl implements mgShopReviewService {
    @Autowired
    private mgShopReviewMapper mgshopReviewMapper;

    @Override
    public void insert(MgShopReview mgShopReview) {
        mgshopReviewMapper.insert(mgShopReview);
    }

    @Override
    public void delete(String id) {
        mgshopReviewMapper.deleteById(id);
    }

    @Override
    public void update(MgShopReview mgShopReview) {
        mgshopReviewMapper.save(mgShopReview);
    }

    @Override
    public List<MgShopReview> list() {
        return mgshopReviewMapper.findAll();
    }

    @Override
    public MgShopReview getById(String id) {
        return mgshopReviewMapper.findById(id).orElse(new MgShopReview());
    }
}